<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj = {
            name:"张飞",
            age:20,
            gender:"男"
        }
        delete obj.age;
        console.log(obj);

        class People{}
        class Animal{}
        class ChinesePeople extends People{}
        let obj1 = new People();
        let obj2 = new Animal();
        let obj3 = new ChinesePeople();

        // 判断对象的类型
        console.log(typeof obj); // object
        console.log(typeof function(){}); // function
        console.log(typeof "hello"); // string
        console.log(typeof 111); // number
        console.log(typeof false); // boolean
        console.log(typeof null); // object
        console.log(typeof undefined); // undefined
        console.log(typeof obj1,typeof obj2);

        // instanceof：检测对象的类型
        // 子类同样属于父类的类型
        console.log(obj1 instanceof People,obj1 instanceof Animal);
        console.log(obj2 instanceof People,obj2 instanceof Animal);
        console.log(obj3 instanceof ChinesePeople,obj3 instanceof People);
    </script>
</body>
</html>